package com.shhm.business.dto.response;

import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @author JackZ
 * @version 1.0
 * @description: TODO
 * @date 2025/9/12 下午4:14
 */
@Data
public class ProductInfoResp implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    // 来自tb_product表的字段
    private Integer productId;
    private String productNum;
    private String productName;
    private Integer productType;
    private Integer productOld;
    private Double productPrice;
    private String productImage;
    private List<String> productDetailImages;
    private String productDesc;
    private String productLocation;
    private String applicablePeople;
    private Integer universityId;
    private Integer sellerId;
    private String productDetailImgs;

    // 来自tb_product_type表的关联字段
    private String typeName;

    // 来自sys_user表的关联字段
    private String sellerNickName;
    private String universityName;

    public void handleProductDetailImages(){
        if(productDetailImgs != null && !productDetailImgs.isEmpty()){
            this.productDetailImages = List.of(productDetailImgs.split(","));
        }
    }
}
